package com.yuxi.shuzu;

import java.util.Scanner;

public class Demo5 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入一个整数:");
        int x = input.nextInt();
        String str = getShuwei(x);
        System.out.println(str);
    }

    public static String getShuwei(int x) {
        int a = x;
        int count = 0;
        while (true) {
            a = a / 10;
            count++;
            if (a==0){
                break;
            }

        }
        String str = x+"是"+count+"位数";

        return str;
    }
}
